!= (Inequality)

The "Inequality" or "Not Equal" operator is used to determine whether or not the two operands are not equal to each other. A result of true is returned if the left and right operands are not equal. A result of false is returned if it is found that the left and right operands are equal. If either of the two operands are of a data type other than a Number, an attempt is made to convert the operands to Numbers before being evaluated.

syntax:

numberOne != numberTwo

EXAMPLE

var operandOne = new String("67");

if (operandOne !=; 100) {

document.write("The result is true")

} else {

document.write("The result is false")

}

This example declares a variable, variableOne, and stuffs it with the string "67". The Inequality operator is then used to determine whether the "67" (now converted to a Number data type) is not equal to the Number 100. Since it isn't, the if / else statement will return the message "The result is true".